<template>
    <div>
        <h1>房号显示</h1>
        房间号 <input type="text" v-model="info.names">
        房间创建人 <input type="text" v-model="info.fhname">
        <input type="button"  value="查询" @click="getlist">
        <table class="table table-bordered">
            <tbody>
                <tr>
                    <td>Id</td>
                    <td>房间号</td>
                    <td>房间创建人</td>
                    <td>状态</td>
                </tr>

                <tr v-for="itme in data.list":key="itme.Id">
                    <td>{{ itme.Id }}</td>
                    <td>{{ itme.Name }}</td>
                    <td>{{ itme.FHName }}</td>
                    <td>{{ itme.State ?"启用":"禁用" }}</td>
                </tr>
            </tbody>
        </table>
    </div>
</template>

<script setup lang="ts">
import {ref,reactive,onMounted} from 'vue'
import axios from 'axios';
import { useRouter } from 'vue-router';
const router=useRouter();
let info:any=reactive({
    names:'',
    fhname:''
})
let data:any=reactive({
    list:[]
})
onMounted(()=>{
    getlist();
})
const getlist=()=>{
    axios({
        url:'/api/FH/GetShow',
        method:'get',
        params:info
    })
    .then((res)=>{
        console.log(res);
        data.list=res.data
    })
    .catch((err)=>{
        console.log(err);
        
    })
}

</script>

<style scoped>

</style>